package com.mm.scheme.config;

import cn.hutool.core.util.StrUtil;
import com.mm.api.client.AiClient;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @BelongsProject: 8.mindmap
 * @BelongsPackage: com.mm.common.utils
 * @Author : 游在海里的鱼
 * @CreateTime : 2024-05-17  15:49
 * @Version : 1.0
 * @ClassName : TODO
 * @Description : TODO
 */
@Component
@RequiredArgsConstructor
public class AiUtils {

    private final AiClient aiClient;

    public  String chat3(String chat){
        if(StrUtil.isBlank(chat)){
            return null;
        }
        String ret = aiClient.chatGPT3(chat).getData().toString();
        System.out.println(ret);
        return ret;
    }

    public  String chat4(String chat){
        if(StrUtil.isBlank(chat)){
            return null;
        }
        return aiClient.chatGPT4(chat).getData().toString();
    }
}
